package demo.mqserver.mapper;

import demo.mqserver.core.Binding;
import demo.mqserver.core.Exchange;
import demo.mqserver.core.MSGQueue;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MetaMapper {

    //提供三个核心建表方法
    void createExchangeTable();

    void createQueueTable();

    void createBindingTable();

    //针对上述三个基本概念，进行 插入 搜索 和 删除
    void insertExchange(Exchange exchange);
    List<Exchange> selectAllExchanges();
    void deleteExchange(String exchangeName);

    void insertQueue(MSGQueue queue);
    List<MSGQueue> selectAllQueues();
    void deleteQueue(String queueName);

    void insertBinding(Binding binding);
    List<Binding> selectAllBindings();
    void deleteBinding(Binding binding);
}
